<block name="extLink"> <!-- 扩展JS/CSS --> </block>
<script type="text/javascript">
<block name="jqueryScript">
$(function(){
	//禁止弹出层自动关闭
	//$.jqm.params.closeoverlay = false;
	<block name="beforeGrid">
	//渲染表格之前或页面使用的Jquery函数
	</block>
	//默认参数
	var defaultJqGridOptions={
		url:BASE+"/admin/{$Think.CONTROLLER_NAME}/{$Think.ACTION_NAME}",	//获取表格数据地址
		datatype:"JSON",	//数据类型
		mtype:"POST",		//提交方式
		colNames:[{$Lang.COL_NAMES}],	//列名
		caption:"{$Lang.CAPTION}",		//表名
		sortname:"id",		//排序字段
		sortorder:"asc",	//排序方式
		rownumbers:true,	//显示行号
		viewrecords:true,	//显示数据
		rowNum:20,			//显示行数
		jsonReader:{		//解析数据方式
			repeatitems:false,
			id:"id"
		},
		pager:"#{$layout}_{$Think.ACTION_NAME}_pager",	//操作条
		multiselect:false, 	//不允许多选
		shrikToFit:true,	//自适应宽度
		editurl:BASE+"/admin/{$Think.CONTROLLER_NAME}/{$Think.ACTION_NAME}_oper"	//编辑地址
	};
	//默认显示操作条设置
	var defaultPagerVisiableOptions={
		edit:<if condition="$pager.edit eq 1">true<else/>false</if>,
		add:<if condition="$pager.add eq 1">true<else/>false</if>,
		del:<if condition="$pager.del eq 1">true<else/>false</if>,
		search:false,
		view:true,
		refresh:true
	};
	var defaultPagerEditOptions={
		afterSubmit:process,
		closeOnEscape:true,
		closeAfterEdit: false
	};
	var defaultPagerAddOptions={
		afterSubmit:process,
		closeOnEscape:true,
		closeAfterAdd:false
	};
	var defaultPagerDelOptions={
		afterSubmit:process,
		closeOnEscape:true,
		closeAfterDel: true	
	}
	var defaultPagerSearchOptions={};
	var defaultPagerViewOptions={
		width:300,
		closeOnEscape:true
	}
	<block name="extOptions">
	//表格扩展配置
	</block>
	//渲染表格
	$("#{$layout}_{$Think.ACTION_NAME}_table").jqGrid(defaultJqGridOptions);
	//分别对每一个按钮进行设置
	$("#{$layout}_{$Think.ACTION_NAME}_table").jqGrid("navGrid","#{$layout}_{$Think.ACTION_NAME}_pager",defaultPagerVisiableOptions,defaultPagerEditOptions,defaultPagerAddOptions,
			defaultPagerDelOptions,defaultPagerSearchOptions,defaultPagerViewOptions);
	<block name="afterGrid">
	//表格渲染完成后执行的函数
	</block>
})
</block>
<block name="extFunction">
//扩展函数
</block>
</script>

<if condition="$layout eq 'load'">
<div id="show_{$layout}_{$Think.ACTION_NAME}_table">
<else />
<div id="show_{$layout}_{$Think.ACTION_NAME}_table" class="main">
</if>
<block name="beforeGridHtml"> </block>
<block name="mainLayout">
	<switch name="layout"> 
		<case value="load"><include file="Common/grid_load_layout" /></case> 
		<case value="full"><include file="Common/grid_full_layout" /></case>
		<default /><include file="Common/grid_default_layout" /> 
	</switch> 
</block>
<block name="afterGridHtml"> </block>
</div>